//
//  AppDelegate.m
//  车福内测
//
//  Created by heew on 15/12/7.
//  Copyright © 2015年 heew. All rights reserved.
//

#import "AppDelegate.h"
#import "QGAdHocListController.h"
#import "QGAdhocUploadController.h"
#import "QGWebViewController.h"

@interface AppDelegate ()

@end

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    
    QGAdHocListController *downloadListVc = [[QGAdHocListController alloc] init];
    QGAdhocUploadController *uploadListVc = [[QGAdhocUploadController alloc] init];
    QGWebViewController *webVc = [[QGWebViewController alloc] init];
    UINavigationController *downloadNav = [[UINavigationController alloc] initWithRootViewController:downloadListVc];
    UINavigationController *uploadNav = [[UINavigationController alloc] initWithRootViewController:uploadListVc];
    UINavigationController *webNav = [[UINavigationController alloc] initWithRootViewController:webVc];
    downloadNav.tabBarItem.title = @"下载";
    uploadNav.tabBarItem.title = @"上传";
    webVc.tabBarItem.title = @"蒲公英";
    downloadNav.tabBarItem.image = [UIImage imageNamed:@"cloud_download"];
    uploadNav.tabBarItem.image = [UIImage imageNamed:@"cloud_upload"];
    webVc.tabBarItem.image = [UIImage imageNamed:@"pgy"];
    
    UITabBarController *tabVc = [[UITabBarController alloc] init];
    [tabVc addChildViewController:downloadNav];
    [tabVc addChildViewController:uploadNav];
    [tabVc addChildViewController:webNav];
    
    UIUserNotificationType type = UIUserNotificationTypeBadge | UIUserNotificationTypeAlert ;
    UIUserNotificationCategory *category = [[UIUserNotificationCategory alloc] init];
    NSSet *set = [NSSet setWithObject:category];
    UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:type categories:set];
    [[UIApplication sharedApplication] registerUserNotificationSettings:settings];
    
    self.window.rootViewController = tabVc;
    [self.window makeKeyAndVisible];
    
    return YES;
}

@end
